# Definition for singly-linked list.
class ListNode:
    def __init__(self, x):
        self.val = x
        self.next = None

    def __str__(self):
        return str(self.val)


class Solution:
    def deleteNode(self, node:ListNode):
        node.val = node.next.val
        node.next = node.next.next





def buildTreeNode(nodes):
    print(nodes)
    a = []
    for val in nodes:
        a.append(ListNode(val))

    for i in range(len(a) - 1):
        a[i].next = a[i + 1]
    return a[0]


if __name__ == '__main__':
    so = Solution()
    head = [4,5,1,9]
    node = 5
    r = so.deleteNode(head, node)
    print(r)
